﻿Imports System.Runtime.Serialization

<Serializable()>
Public Class BodyGlossEntry
    Implements ISerializable


#Region "Serialization"
    Private Sub New(info As SerializationInfo, context As StreamingContext)
        Dim version As Integer = info.GetInt32("version")

        If version >= 1 Then
            Id = info.GetString("id")
            Source = info.GetValue(Of RawSource)("source")
            Library = info.GetValue(Of RawLibrary)("library")
            GlossToken = info.GetValue(Of Token)("glossToken")
        End If
    End Sub


    Public Sub GetObjectData(info As SerializationInfo, context As StreamingContext) Implements ISerializable.GetObjectData
        info.AddValue("version", 1)

        'Version 1 data
        info.AddValue("id", Id)
        info.AddValue("source", Source)
        info.AddValue("library", Library)
        info.AddValue("glossToken", GlossToken)
    End Sub
#End Region

    Public Sub New()

    End Sub


    Public Property Id As String
    Public Property Source As RawSource
    Public Property Library As RawLibrary
    Public Property GlossToken As Token
End Class
